<link rel="stylesheet" href="__STATIC__/addons/editormd/css/editormd.min.css">
<script type="text/javascript" src="__STATIC__/addons/editormd/editormd.min.js"></script>
<div class="layui-form-item">
    <label class="layui-form-label {if condition="isset($vo.ifrequire) AND $vo.ifrequire"}layui-form-item-required{/if}">{$vo.title}</label>
    <div class="layui-input-block">
        <div class="js-editormd" id="{$vo.name}">
            <textarea style="display:none;" name="{$vo.fieldArr}[{$vo.name}]">{$vo.value}</textarea>
        </div>
    </div>
    {if $vo.remark}<div class="layui-form-mid2 layui-word-aux">{$vo.remark|raw}</div>{/if}
</div>
<script type="text/javascript">
    GV.editormd_upload_url='{$editormd_upload_url ? $editormd_upload_url : url("attachment/upload/upload", ["dir" => "images", "from" => "editormd", "module" => request()->module()])}';
    GV.editormd_mudule_path='__STATIC__/addons/editormd/lib/';
    $(function() {
        var editormds = {};
        if ($(".js-editormd").size() > 0) {
            $('.js-editormd').each(function() {
                var editormd_name = $(this).attr('id');
                editormds[editormd_name] = editormd(editormd_name, {
                    height: 500, // 高度
                    watch: true,
                    searchReplace: true,
                    toolbarAutoFixed: false, // 取消工具栏固定
                    path: GV.editormd_mudule_path, // 用于自动加载其他模块
                    codeFold: true, // 开启代码折叠
                    dialogLockScreen: false, // 设置弹出层对话框不锁屏
                    imageUpload: true, // 开启图片上传
                    imageUploadURL: GV.editormd_upload_url,
                });
            });
        }
    });
</script>